﻿using System;
using System.Collections;
using System.Text;
using System.Configuration;
using System.Xml;
using System.Collections.Generic;
using System.Web;

namespace SolutionFramework
{
    public class AbstraXProviderHandler : IConfigurationSectionHandler, IHttpHandler
    {
        public object Create(object parent, object configContext, XmlNode section)
        {
            List<string> assemblies = new List<string>();

            // Gets the child element names and attributes.
            foreach (XmlNode child in section.ChildNodes)
            {
                if (XmlNodeType.Element == child.NodeType)
                {
                    foreach (XmlAttribute childAttrib in child.Attributes)
                    {
                        if (XmlNodeType.Attribute == childAttrib.NodeType)
                        {
                            assemblies.Add(childAttrib.Value);
                        }
                    }
                }
            }

            return assemblies;
        }

        public bool IsReusable
        {
            get 
            {
                return true;
            }
        }

        public void ProcessRequest(HttpContext context)
        {
        }
    }
}